package com.by.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {

    String url;
    String username;
    String password;
    String bucketName;

    @Bean
    public MinioClient MinioClient(){
        return MinioClient.builder()
                .endpoint(url)
                .credentials(username, password)
                .build();
    }
} 